var express = require('express')
var router = express.Router()
var userHandler = require('../router_handler/user')
const { requestVerify } = require('../middleware/verify')

router.get('/getUser', userHandler.getUser)
//增加商品
router.post('/goods', requestVerify, userHandler.addGoods)
//更改商品信息
router.put(
  '/goods',
  requestVerify,
  userHandler.upDateGoodsByID
)
//删除商品
router.delete(
  '/goods',
  requestVerify,
  userHandler.deleteGoodsByName
)
//查询订单
router.get('/orders',requestVerify,userHandler.getOrders)
router.get('/sse', userHandler.notifyOrder)
//删除订单
router.delete(
  '/orders',
  requestVerify,
  userHandler.deleteOrders
)
router.post('/changePsw', requestVerify, userHandler.changePws)

module.exports = router
